package com.Ajava1704.for并发包下的类.Forlock;

import java.util.concurrent.Semaphore;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @类名: com.Ajava1704.for并发包下的类.Forlock
 * @作者: lgt
 * @创建时间: 2020-02-11 20:57
 * @描述:
 **/
public class TestLock {
    public static void main(String[] args) {
        Lock lock=new ReentrantLock();

        Semaphore semaphore=new Semaphore(1);

        Thread thread2=new Thread(new ForReentLockRunable(semaphore),"A");
        thread2.start();

        Thread thread3=new Thread(new ForReentLockRunable(semaphore),"B");
        thread3.start();

        Thread thread4=new Thread(new ForReentLockRunable(semaphore),"C");
        thread4.start();
    }
}
